<!doctype html>

<html>

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta name="apple-mobile-web-app-capable" content="yes" />

<meta name="apple-touch-fullscreen" content="yes" />

<meta name="format-detection" content="telephone=no"/>

<meta name="apple-mobile-web-app-status-bar-style" content="black" />

<meta name="format-detection" content="telephone=no" />

<meta name="msapplication-tap-highlight" content="no" />

<meta name="viewport" content="initial-scale=1,maximum-scale=1,minimum-scale=1" />

<title>经验值明细</title>

<link rel="stylesheet" type="text/css" href="../../css/base.css">

<link rel="stylesheet" type="text/css" href="../../css/nctouch_member.css">
<style>
.alert-block {
padding-top: 14px;
padding-bottom: 14px;
}
.alert {
color: #C09853;
background-color: #FCF8E3;
padding: 9px 14px;
margin: 10px auto;
border: 1px solid #FBEED5;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
 overflow:hidden
}
.alert h4 {
font-size: 16px;
font-weight: bold;
line-height: 1.5em;
margin-bottom: 2px;
}
.alert li{font-size:0.5rem}
.alert a {
color: #927036;
text-decoration: underline;
}
a.ncbtn-bittersweet {
background-color: #FB6E52;
}
a.ncbtn {
height: 20px;
padding: 5px 10px;
border-radius: 3px;
}
a.ncbtn, a.ncbtn-mini {
font: 400 12px/20px "microsoft yahei",arial;
color: #FFF;
text-align: center;
vertical-align: middle;
display: inline-block;
height: 20px;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
}
</style>
</head>

<body>

<header id="header">

  <div class="header-wrap">

    <div class="header-l"><a href="javascript:history.go(-1)"><i class="back"></i></a></div>

    <div class="header-tab"><a href="grade.html">我的成长进度</a><a href="javascript:void(0);" class="cur">经验值明细</a></div>

    <div class="header-r"> <a id="header-nav" href="javascript:void(0);"><i class="more"></i><sup></sup></a> </div>

  </div>

  <div class="nctouch-nav-layout">

    <div class="nctouch-nav-menu"> <span class="arrow"></span>

      <ul>

        <li><a href="../../index.html"><i class="home"></i>首页</a></li>

        <li><a href="../search.html"><i class="search"></i>搜索</a></li>

        <li><a href="member.html"><i class="member"></i>个人中心</a><sup></sup></li>

        <li><a href="javascript:void(0);"><i class="message"></i>消息<sup></sup></a></li>

      </ul>

    </div>

  </div>

</header>

<div class="nctouch-main-layout">

  <div id="pointscount" class="nctouch-asset-info"></div>

  
  <ul id="pointsloglist" class="nctouch-log-list">

  </ul>

</div>

<footer id="footer" class="bottom"></footer>

<script type="text/html" id="pointscount_model">

	<div class="container point">

		<i class="icon"></i>

			<dl>

				<dt>我的经验值</dt>

				<dd><em><%=exppoints;%></em></dd>

			</dl>

	</div>

</script> 

<script type="text/html" id="list_model">

        <% if(log_list.length >0){%>

        <% for (var k in log_list) { var v = log_list[k]; %>

            <li><dl><dt><%=v.stagetext;%></dt>

                <dd><%=v.pl_desc;%></dd>

				</dl>

                <% if(v.pl_points >0){%>

                <div class="money add">+<%=v.pl_points;%></div>

                <%}else{%>

                <div class="money reduce"><%=v.pl_points;%></div>

                <%}%>

                <time class="date"><%=v.addtimetext;%></time>

            </li>

        <%}%>

        <li class="loading"><div class="spinner"><i></i></div>数据读取中</li>

        <%

        }else {

        %>

       <div class="nctouch-norecord signin" style="top: 70%;">

        <div class="norecord-ico"><i></i></div>

        <dl>

            <dt>您还没有任何经验值记录</dt>

			<dd>每日签到或购买商品可获取经验值</dd>

        </dl>

    	</div>

        <%

        }

        %>

    </script> 

<script type="text/javascript" src="../../js/config.js"></script> 

<script type="text/javascript" src="../../js/zepto.min.js"></script> 

<script type="text/javascript" src="../../js/template.js"></script> 

<script type="text/javascript" src="../../js/common.js"></script> 

<script type="text/javascript" src="../../js/ncscroll-load.js"></script> 

<script>

    $(function(){
	$('#button').click(function(){
	    var red_points=$('#red_points').val();
	    if (red_points>0) {
	    	 $.ajax({
                type: "post",
                url: ApiUrl + "/index.php?act=member_points&op=memberpoints",
                data: {
                    red_points: red_points,
					'key':key        
                },
                dataType: "json",
                  success: function(a) {
				 // alert(a.datas.update);
                  if (a.datas.update>0) {
                        location.href = WapSiteUrl + "/tmpl/member/reds_pointslog_list.html"
                    } else {
					   alert('条件不购，您的经验值未达到100！');
                      //  location.href = WapSiteUrl
                    }
                }
            })
	    }else{
	    	alert('请输入正确的数值!');
	    }
	});

        var key = getCookie('key');

        if (!key) {

            window.location.href = WapSiteUrl+'/tmpl/member/login.html';

            return;

        }

		

        //渲染list

        var load_class = new ncScrollLoad();

        load_class.loadInit({'url':ApiUrl + '/index.php?act=member_points&op=exp_pointslog','getparam':{'key':key},'tmplid':'list_model','containerobj':$("#pointsloglist"),'iIntervalId':true});



        //获取我的经验值

        $.getJSON(ApiUrl + '/index.php?act=member_index&op=my_asset', {'key':key,'fields':'point'}, function(result){

            var html = template.render('pointscount_model', result.datas);

            $("#pointscount").html(html);

        });

    });

</script>

</body>

</html>